package com.yc.tomcat.impl;

import com.yc.tomcat.HttpServletRequest;
import com.yc.tomcat.HttpServletResponse;
import com.yc.tomcat.ServletException;

import java.io.IOException;
import java.io.PrintWriter;

public class GetLoginedUserServlet extends HttpServletImpl{
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        response.setContentType("application/json;charset=utf-8");
        PrintWriter out = response.getWriter();
        Object loginedUser = request.getSession().getAttribute("loginedUser");
        if(loginedUser!=null){
            out.println(loginedUser);
        }
    }
}
